package org.example.service;

import com.baomidou.dynamic.datasource.annotation.DS;
import org.example.dto.Dog;
import org.example.mapper.DogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DynamicsSwitchService {

    @Autowired
    private DogMapper dogMapper;

    @DS("#session.dataSourceKey")
    public List<Dog> findList(){
        return dogMapper.findList();
    }

}
